package com.itcast.service.Impl;

import com.itcast.dao.UserDao;
import com.itcast.service.UserService;

public class UserServiceImpl implements UserService {
    private UserDao userdao;
    private String name;

   /* public void setUserdao(UserDao userdao) {
        this.userdao = userdao;
    }*/

    public UserServiceImpl() {
    }

    public UserServiceImpl(UserDao userdao,String name) {
        System.out.println("构造方法的依赖注入");
        this.name=name;
        this.userdao = userdao;

    }

    public void query() {
        userdao.query();
        System.out.println(name);//测试依赖注入是否成功


    }
}
